/* eslint-disable */ 
export function searchPath(tree:Array<any>,k:string):undefined|Array<any>{
    if(!tree||!tree.length)return
    let res:undefined|Array<any>;
    for(let i=0;i<tree.length;i++){
        const node = tree[i]
        if (node.action === k) return [node]
        res = searchPath(node.children,k)
        if (res)
        return [...res,node]
    }
}
